package cn.qzzg.demo.controller;

import cn.qzzg.demo.service.HelloService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: kejc
 * @CreateTime: 2025-01-10 16:07
 **/
@RestController
public class HelloSpringbootController {

    @DubboReference(url = "dubbo://194.0.11.58:2881")
    private HelloService helloService;

    /**
     * 第一个方法
     *
     * @return
     */
    @GetMapping("/")
    public String hello() {
        return "Hello Dubbo Consumer !";
    }


    @RequestMapping("/user/{name}")
    public String getUser(@PathVariable("name") String name) {
        return helloService.sayHello(name);
    }
}
